package com.tamecode.bean.method.di;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class MagicBossImpl implements MagicBoss, ApplicationContextAware {

    private ApplicationContext ctx;

    @Override
    public Car getCar() {
        return (Car) ctx.getBean("car");
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.ctx = ctx;
    }
}
